#ifndef WATERPROGRESSBAR_H
#define WATERPROGRESSBAR_H

#include<QWidget>
class SWaterProgressBarPaivate;
class WaterProgressBar:public QWidget
{
    Q_OBJECT
public:
    explicit WaterProgressBar(QWidget* parent=nullptr);
    ~WaterProgressBar();
    int Minimun()const;
    int Maximun()const;
    int value()const;
    bool isTextVisiable()const;
protected:
    void paintEvent(QPaintEvent* ev)override;
    void drawBackground(QPainter* painter);
    void drawProgress(QPainter* painter);
    void drawText(QPainter* painter);
    void resizeEvent(QResizeEvent* ev)override;
    void timerEvent(QTimerEvent* ev)override;
public slots:
    void setRange(int minimun,int maximun);
    void setMinimun(int minimun);
    void setMaximun(int maximun);
    void setValue(int value);
    void setTextVisiable(bool visiable);
signals:
    void valueChanged(int value);
private:
    //成员变量类
    QScopedPointer<SWaterProgressBarPaivate> d;
};

#endif // WATERPROGRESSBAR_H
